--暗境春生
local anjinchunsheng = fk.CreateSkill {
    name = "mcdh_anjinchunsheng",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

anjinchunsheng:addEffect('active',{
    card_num = 0,
    target_num = 1,
    can_use = function(self, player)
        return player:usedSkillTimes(self.name,Player.HistoryPhase) == 0
    end,
    target_filter = function(self, player,to_select, selected)
        return #selected == 0 and to_select ~= player and not to_select:isNude()
    end,
    on_use = function(self, room, effect)
        local player =effect.from
        local to = effect.tos[1]
        local ids =  room:askForCardsChosen(player, to,1,999 ,"he", self.name)
        local  flag = #table.filter(ids,function(id) return Fk:getCardById(id).color == Card.Red  end) == 0
        room:throwCard(ids, self.name, to, player)
        if not flag  then
            to:drawCards(#ids,self.name)
        end
    end
})



Fk:loadTranslationTable {
    ["mcdh_anjinchunsheng"] = "暗境春生",
    [":mcdh_anjinchunsheng"] = "出牌阶段限一次，你可以弃置一名其他角色至少一张牌，若其中有红色牌，其摸等量张牌。",
}

return anjinchunsheng